<template>
    <el-dialog
    :title="dialogTitle"
    :visible.sync="caseInfoHistory"
    width="85%"
    center>
    <div>
      <div>
        <el-table
          :data="caseInfoHistoryList"
          border
          class="table"
          ref="multipleTable"
          header-cell-class-name="table-header"
          style="margin-top: 10px"
        >
          <el-table-column prop="caseNo" label="大病赔案号" align="center" show-overflow-tooltip>
            <!-- <template slot-scope="scope">
              <el-link type="primary" :href="'caseProcessDetail#/caseProcessDetail?taskNo='+scope.row.caseNo"
                       target="_blank">{{scope.row.caseNo}}
              </el-link>
            </template> -->
          </el-table-column>
          <el-table-column prop="policyNo" label="保单号" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="insuredName" label="被保险人" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="insuredNumber" label="证件号" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="sumPayAmount" label="赔付金额" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="qualifiedFee" label="大病合规医疗金额" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="endCaseDate" label="结案时间" align="center" show-overflow-tooltip></el-table-column>
        </el-table>
      </div>
    </div>
    <div class="pagination">
      <el-pagination :current-page="pagination.currentPage" :page-size="pagination.rowsNumber"
            :total="pagination.totalPage" background layout="prev, pager, next,total,jumper"
              @current-change="queryFun">
      </el-pagination>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button type="info" @click="caseInfoHistory = false">关 闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import * as api from '@/api/baseDate'
export default {
  name: "HistoryComponent",
  props: {
    dialogTitle: {
      type: String,
      default: "历史赔付案件信息",
    },
    toChildrenData:{
      type: Object,
      default () {
        return {}
      }
    }

  },
  data() {
    return {
    caseInfoHistory: false,
    caseInfoHistoryList:[],
    pagination: {
        currentPage: 1, // 当前页
        rowsNumber: 5, // 每页条数
        totalPage: 0 // 总条数
    },
    };
  },
  methods: {
       //疾病分页
       queryFun(pageNum){ // 改变当前页事件
        this.pagination.currentPage=pageNum
        this.caseInfoHistorys();
       },
       caseInfoHistorys(){
        var data = {
          "policyNo": this.toChildrenData.policyNo,
          "insuredNumber": this.toChildrenData.insuredNumber,
          "pageNum":this.pagination.currentPage,
          "pageSize":this.pagination.rowsNumber
        }
        api.queryCaseInfoHistory(data
        ).then(res => {
          this.caseInfoHistoryList = res.data.list;
          this.pagination.totalPage = res.data.total;
        })
      }

  }
};
</script>
